#ifndef __MODULE_LIST_MODEL___
#define __MODULE_LIST_MODEL___


#include <QAbstractListModel>
#include <QObject>
#include "module.h"


class ModuleListModel : public QAbstractListModel
{
    Q_OBJECT

public:
    ModuleListModel(const QList<Module> &module, QObject *parent = 0);
    virtual ~ModuleListModel();

    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role) const;
    QVariant headerData(int section, Qt::Orientation orientation,
                        int role = Qt::DisplayRole) const;

    Qt::ItemFlags flags(const QModelIndex &index) const;
    bool setData(const QModelIndex &index, const QVariant &value,
                 int role = Qt::EditRole);

    bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex());
    bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex());

private:
    QList<Module> moduleList;
};


#endif //__MODULE_LIST_MODEL___
